package org.example;

import org.example.ui.customer.BottomPanel;

public class Lock {
    public boolean b = false;
    public synchronized void onLock() {
        while (!b) {
            try {
                wait();
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
        b = false;
        notifyAll();
    }
    public synchronized void unLock() {
        while (b) {
            try {
                wait();
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
        b = true;
        notifyAll();
    }
}
